<template>
	<ls-page title="成为合伙人">
		<view class="continar">
			<!-- Banner 图片 -->
			<image class="banner-img"
				:src="img ? img : 'https://jtmc.oss-cn-hangzhou.aliyuncs.com/wmp/zttt/common/i_hehuo.png'" mode="">
			</image>

			<!-- 共享股东权益标题 -->
			<view class="gx-title">共享股东权益</view>

			<view style="padding-left:12rpx">
				<!-- 通过 v-for 渲染 remark 数组中的内容 -->
				<view class="mask-info" v-for="(v, k) in remark" :key="k">{{ v }}</view>
			</view>

			<!-- 提交按钮 -->
			<view class="sumbit-btn" @click="onSubmit">￥{{ comSharingAmt }}成为合伙人</view>
		</view>
	</ls-page>
	<pay v-if="payShow" :show="payShow" @update:show="payShow = $event" @finishPay="confirmPay($event)" payto="comSharing" :info="payForm" />
</template>

<script setup>
	import dayjs from 'dayjs';
	import { HFiveMemberAppObjProcess } from '@/api/public.js'
	import { ref, onMounted, onUnmounted } from 'vue'
	import { _FormatNumber } from '@/until/tools.js'


	const username = ref('');
	const password = ref('');
	const comSharingAmt = ref('');
	const cardInfo = ref(uni.getStorageSync('storeCard')) //门店卡信息
	const remark = ref([]);
	const img = ref('');

	
	const shopInfo = ref('')
	onShow(async()=>{
		
		shopInfo.value = uni.getStorageSync('shopInfo') //门店信息
		comSharingAmt.value = shopInfo.value.comSharingAmt
		console.log(cardInfo.value);
		if (cardInfo.value && cardInfo.value.upCardRemark) {
		    const arr = cardInfo.value.upCardRemark.split("<br>");
		    remark.value = arr;
		}
	})

	const payShow = ref(false)
	const payForm = ref({})
	//     // 提交处理
	const onSubmit = () => {
		
		const cardNo = cardInfo.value.code;
		const fee = shopInfo.value.comSharingAmt;
		payForm.value = {
			cardNo,
			fee
		}
		console.log(payForm.value,'payForm.value')
		payShow.value = true

	};

	
</script>

<style lang="scss">
	.continar {
		padding: 24rpx;
		position: relative;

		.banner-img {
			width: 100%;
			height: 560rpx;
		}

		.part-box {
			padding: 40rpx 24rpx 60rpx 24rpx;
			margin-top: 20rpx;
			background: #ffffff;
			border-radius: 16rpx;

			.store-title {
				font-weight: bold;
				font-size: 36rpx;
				color: #000000;
			}
		}
	}

	.form-box .van-cell {
		width: 100%;
		height: 80rpx;
		background: #f2f2f2 !important;
		border-radius: 16rpx;
	}

	.form-box .van-cell__title {
		min-width: 140rpx !important;
		max-width: 140rpx !important;
	}

	.gx-title {
		margin-top: 60rpx;
		font-weight: bold;
		font-size: 36rpx;
		color: #000000;
		margin-bottom: 40rpx;
	}

	.mask-info {
		font-weight: 500;
		font-size: 28rpx;
		color: #000000;
		margin-bottom: 20rpx;
	}

	.sumbit-btn {
		position: fixed;
		bottom: 100rpx;
		left: 50%;
		width: 702rpx;
		transform: translateX(-50%);
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		background: #212121;
		border-radius: 40rpx;
		font-weight: bold;
		font-size: 32rpx;
		color: #FFFFFF;
	}
	::v-deep{
		.popup-content{
			padding: 0;
		}
		.close-img{
			z-index: 10;
		}
	}
</style>